package edu.gdut.tiantian.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

//日期格式转换工具类
public class DateUtils {
	public static String DateToString(Date date,String pattern){
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		return sdf.format(date);
	}
	
	public static Date StringToDate(String date,String pattern) throws Exception {
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		return sdf.parse(date);
	}
}
